This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Oct 27, 2011, 8:31 PM
10 Posts
topic has been resolvedResolved

postNewDocument event

  • Category: Server Side JavaScript
  • Platform: Windows
  • Release: 8.5.3
  • Role: Developer
  • Tags: events postNewDocument
  • Replies: 2
I added some code to the "postnewDocument" event and it is running that code properly.  I am now trying to modify that code and I need to get some information from the "new document" that was just created.
 
How do I get a reference to the just created document?

Oct 28, 2011, 11:05 AM
272 Posts
Re: postNewDocument event
Hi,
 
you can reference the document by using the name of the datasource:
 
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">

    <xp:this.data>
        <xp:dominoDocument var="document1"
            postNewDocument="#{javascript:viewScope.id = document1.getDocument().getUniversalID();}">
        </xp:dominoDocument>
    </xp:this.data>
    
    <xp:label value="#{javascript:viewScope.id}" id="label1"></xp:label>
</xp:view
>
 
 
Hope this helps
Sven
Nov 15, 2011, 9:08 PM
10 Posts
Re: postNewDocument event
My confusion. I was confused when that even occurred.  I thought that it ran on the post (save) of a new document but it doesn't.  My question now makes no sense since that document doesn't yet exist when this runs you can't manipulate it.
I approached my problem another way. 
 
Thanks!

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal